<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>canvas</title>
</head>
<body>

	<canvas id="canvas" width="200" height="100" style="border: 1px solid #ccc">
		当前浏览器不支持HTML5 canvas标签
	</canvas>

	<script type="text/javascript">
		
		window.onload = function () {

			var canvas = document.getElementById("canvas");

			var ctx = canvas.getContext("2d");

			ctx.moveTo(0,0);

			ctx.lineTo(200,100);

			ctx.stroke();

		}

	</script>

</body>
</html>